package kz.edu.sdu.itech.pcs.client;

import java.util.Locale;

import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Logger;

public class Main {
   static Logger log = Logger.getLogger(Main.class);
   static Client client;

   public static void main(String[] args) {
      BasicConfigurator.configure();
      Locale.setDefault(Locale.US);
      try {
         client = new Client(args[0]);
         client.init();
         while (!AppProps.DONE) {
            int q = System.in.read();
            if ((char) q == 'q') {
               log.debug("CLOSING Client");
               AppProps.DONE = true;
               client.close();
            }
         }
      } catch (Exception e) {
         log.error(e.toString());
      }
   }
}
